package pro.cherish.quartzlockdemo.job;

import lombok.extern.slf4j.Slf4j;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

@Slf4j
public class HiJob extends QuartzJobBean {

//    @Autowired
//    HelloWorldService helloWorldService;

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        JobDataMap mergedJobDataMap = jobExecutionContext.getMergedJobDataMap();
        JobDataMap jobDataMap = jobExecutionContext.getTrigger().getJobDataMap();
        log.info("Hi job 中的参数{}", mergedJobDataMap);
        log.info("Hi trigger 中的参数{}", jobDataMap);
//        String hello = helloWorldService.hello();
        System.out.println("    Hi! :" + jobExecutionContext.getJobDetail().getKey());
    }
}